package com.rui.study.algorithm.P_回文串验证;

/**
 * @program: study
 * @description:
 * @author: Yaowr
 * @create: 2019-01-08 10:00
 **/
public class Solution {

    public boolean isPalindrome(String s) {
        if (s == null) return false;
        if (s.equals("")) return true;
        String origin = s.replaceAll("[^\\da-zA-Z]", "").toLowerCase();
        StringBuffer sb = new StringBuffer(origin);
        return origin.equals(sb.reverse().toString());
    }
}
